﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoderJoe.ServiceModel
{
    public class ServiceExceptionManagementAspect
        : AspectBase
    {
        public override void WrapOuter(Action action)
        {
            try
            {
                base.WrapOuter(action);
            }
            catch (Exception ex)
            {
                ExceptionManagement.Publish(ex);
            }
        }

        public override void WrapInner(Action action)
        {
            try
            {
                base.WrapInner(action);
            }
            catch (Exception ex)
            {
                ExceptionManagement.Publish(ex);
            }
        }
    }
}
